const sum = (x, y) => x * y;

console.log(sum(3, 8));

const matchAll = (str, reg) => {
    const matchs = []
    for (let match of str.matchAll(reg)) {
        matchs.push(match[1])
    }
    return matchs
}

